///////////////////////////////////////////////////////////////////////////////
// Name:        adacascadeclass.h
// Purpose:     Adacascadeclass function
// Copyright:   (c) 2006, Ivan Laptev, TT Solutions
// License:     GPL, Please contact us for commercial license.
//              http://www.tt-solutions.com/
///////////////////////////////////////////////////////////////////////////////
#ifndef ADACASCADECLASS_H_
#define ADACASCADECLASS_H_

#include "objectdet/common.h"

// return type of adacascadeclass function 
struct SubWindowInfo
{
    size_t x;
    size_t y;
    size_t w;
    size_t h;

    bool passed;    // weither all the stages have succeeded
    double dfce;    // dfce resulting coeff
    size_t stage;     // the index of the first stage we didnt passed (or stages.size())

    size_t cluster_size;  // this field is filled with prune_windows, it indicates the size of the subwindow cluster

    SubWindowInfo(bool apassed, double adfce, size_t astage,
                  size_t ax = 0, size_t ay = 0, size_t aw = 0, size_t ah = 0)
        : x(ax), y(ay), w(aw), h(ah), passed(apassed), dfce(adfce), stage(astage) {}
};

/**
 * Try to figure out if the following region (rectangle) of the hist-image
 * represents the Goal.
 * 
 * Return true if it could be considered to represent the Goal.
 * Also return the classificator value to the caller
 */
SubWindowInfo adacascadeclass(Model const & model,
                              arrMat integral_block_histogram,
                              size_t channels,
                              size_t left, size_t top,
                              size_t width, size_t height);

#endif

